import { h,ref,nextTick } from "../../lib/guide-leo-vue.esm.js";

export default {
    setup() {
        let count  = ref(0)
        function onClick() {
            for (let i = 0; i < 100; i++) {
                console.log('update');
                count.value = i
            }
            // nextTick(() => {
            //     // 写他的作用就是获取同步任务完全执行完后最后的结果
            //     console.log(count.value);
            // })
        }
        return {
            count,
            onClick
        }
    },
    render() {
        const button = h('button',{onClick:this.onClick},'update')
        const p  = h('div',{},"count："+this.count)
        return h('div',{},[button,p])
    }
}


